package com.pureut.quality.controller;

import java.util.List;
import javax.servlet.http.HttpServletResponse;

import com.pureut.common.core.web.controller.BaseController;
import com.pureut.common.core.web.domain.AjaxResult;
import com.pureut.common.core.web.page.TableDataInfo;
import com.pureut.common.log.annotation.Log;
import com.pureut.common.log.enums.BusinessType;
import com.pureut.quality.domain.AuditSummary;
import com.pureut.quality.domain.AuditSummaryDetails;

import com.pureut.quality.domain.dto.AuditSummaryDetailsDto;
import com.pureut.quality.domain.vo.AuditSummaryDetailsVo;
import com.pureut.quality.domain.vo.SubmitVo;
import com.pureut.quality.service.IAuditSummaryDetailsService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * 审核总结报告明细Controller
 *
 * @author ruoyi
 * @date 2025-04-09
 */
@RestController
@RequestMapping("/auditSummaryDetails")
public class AuditSummaryDetailsController extends BaseController
{
    @Autowired
    private IAuditSummaryDetailsService auditSummaryDetailsService;

    /**
     * 查询审核总结报告明细列表
     */
    @GetMapping("/list")
    public TableDataInfo list(AuditSummaryDetailsVo auditSummaryDetails)
    {
        startPage();
        List<AuditSummaryDetailsDto> list = auditSummaryDetailsService.selectAuditSummaryDetailsList(auditSummaryDetails);
        return getDataTable(list);
    }

    /**
     * 获取审核总结报告明细详细信息
     */
    @GetMapping(value = "/{id}")
    public AjaxResult getInfo(@PathVariable("id") Long id)
    {
        return AjaxResult.success(auditSummaryDetailsService.selectAuditSummaryDetailsById(id));
    }

    /**
     * 修改审核总结报告明细
     */
    @Log(title = "审核总结报告明细", businessType = BusinessType.UPDATE)
    @PutMapping
    public AjaxResult edit(@RequestBody AuditSummaryDetailsVo auditSummaryDetails)
    {
        return toAjax(auditSummaryDetailsService.updateAuditSummaryDetails(auditSummaryDetails));
    }

}
